# @Author ZhangGJ
# @Date 2021/01/06 14:29
import time

import requests
import json

url = ''

num = 1
with open('qr-2.txt', 'r') as f:
    for line in f:
        nline = line.rstrip('\n')
        # print(str(num) + '-' + nline)
        # num += 1
        body = {
            "qrCode": nline
        }
        headers = {'Content-Type': 'application/json'}
        data = json.dumps(body)
        response = requests.post(url=url, data=data, headers=headers)
        res = response.text
        ss = dict(json.loads(res))
        if ss.get('code') == 100:
            print(str(num) + '-' + dict(ss.get('data')).get('atosId') + '-' + dict(
                ss.get('data')).get('qrcode'))
        time.sleep(0.5)
        num += 1